package com.java.member.compoent;

import cn.hutool.extra.mail.MailUtil;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @author jiangli
 * @since 2019/12/10 22:02
 */
@Component
public class AsyncTask {

	@Async
	public void sendEmail(String to, String subject, String content) {
		MailUtil.send(to, subject, content, false);
	}

	@Async
	public void sendEmailHtml(String to, String subject, String content) {
		String html = "<table width='629' height='97' border='0'>\n" +
				"  <tr>\n" +
				"    <td height='67' valign='top'><p>&nbsp;</p>\n" +
				"    \t<p>尊敬的用户" + content + " ，您的ICP备案申请已通过审核，审核通过日期：2019-10-14 11:14:12。</p>\n" +
				"    \t<p>请牢记和妥善保管您的备案号、备案密码，备案密码将是以后变更备案信息的重要依据。</p>\n" +
				"    </td>\n" +
				"  </tr>\n" +
				"  <tr>\n" +
				"    <td height='23' align='right' valign='top'>jl-boot网站系统</td>\n" +
				"  </tr>\n" +
				"</table>";
		MailUtil.send(to, subject, html, true);
	}
}
